#include "DirOpt.h"
#include <boost/filesystem.hpp>
using namespace boost::filesystem;
using namespace boost;

CDirOpt::CDirOpt(void)
{
}

CDirOpt::~CDirOpt(void)
{
}

bool CDirOpt::exists( std::string dir_path )
{
  try
  {
    return boost::filesystem::exists(dir_path);
  }
  catch(...)
  {
    return false;
  }
}

bool CDirOpt::create_directories( std::string dir_path )
{
  try
  {
    return boost::filesystem::create_directories(dir_path);
  }
  catch(...)
  {
    return false;
  }
}

bool CDirOpt::is_empty( std::string dir_path )
{
  try
  {
    return boost::filesystem::is_empty(dir_path);
  }
  catch(...)
  {
    return false;
  }
}

bool CDirOpt::remove_all( std::string dir_path )
{
  try
  {
    boost::uintmax_t ret = boost::filesystem::remove_all(dir_path);
    return true;
  }
  catch(...)
  {
    return false;
  }
}
